package unitTests;

import scanner.Token;
import scanner.TokenType;
import ast.ASTNode;
import ast.ASTTree;
import ast.nodes.BeginNode;
import ast.nodes.ParameterNode;
import ast.nodes.SeriesNode;
import ast.nodes.commandNodes.SubstringNode;

public class ASTTest {
    /**
     * @param args
     */
    public static void main(String[] args) {
        System.out.println("TEST AST\n");

        ASTTree tree = new ASTTree();

        ASTNode node = tree.getRoot().addChild(new BeginNode());

        node.addChild(new ParameterNode(new Token("myString", TokenType.QUOTED_STRING)));

        ASTNode series = tree.getRoot().addChild(new SeriesNode());

//        series.addChild(new RegExNode(new Token("(a|b|c)*", TokenType.REGEX)));

        ASTNode action = series.addChild(new SubstringNode(new Token("substring", TokenType.SUBSTRING)));

        action.addChild(new ParameterNode(new Token("1", TokenType.VARIABLE)));

        action.addChild(new ParameterNode(new Token("EOL", TokenType.EOL)));

        System.out.println(tree.toString());
    }
}
